﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGiGradientBackgroundTraits : OdGiDrawableTraits
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGiGradientBackgroundTraits(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGiGradientBackgroundTraits_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGiGradientBackgroundTraits obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGiGradientBackgroundTraits()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGiGradientBackgroundTraits(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdGiGradientBackgroundTraits cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiGradientBackgroundTraits_cast(OdRxObject.getCPtr(pObj));
			OdGiGradientBackgroundTraits result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiGradientBackgroundTraits)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiGradientBackgroundTraits)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiGradientBackgroundTraits)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiGradientBackgroundTraits_desc(), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiGradientBackgroundTraits_isA(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiGradientBackgroundTraits_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdGiGradientBackgroundTraits createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiGradientBackgroundTraits_createObject();
			OdGiGradientBackgroundTraits result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiGradientBackgroundTraits)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiGradientBackgroundTraits)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiGradientBackgroundTraits)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setColorTop(OdCmEntityColor color)
		{
			GlobalsPINVOKE.OdGiGradientBackgroundTraits_setColorTop(this.swigCPtr, OdCmEntityColor.getCPtr(color));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdCmEntityColor colorTop()
		{
			OdCmEntityColor result = new OdCmEntityColor(GlobalsPINVOKE.OdGiGradientBackgroundTraits_colorTop(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setColorMiddle(OdCmEntityColor color)
		{
			GlobalsPINVOKE.OdGiGradientBackgroundTraits_setColorMiddle(this.swigCPtr, OdCmEntityColor.getCPtr(color));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdCmEntityColor colorMiddle()
		{
			OdCmEntityColor result = new OdCmEntityColor(GlobalsPINVOKE.OdGiGradientBackgroundTraits_colorMiddle(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setColorBottom(OdCmEntityColor color)
		{
			GlobalsPINVOKE.OdGiGradientBackgroundTraits_setColorBottom(this.swigCPtr, OdCmEntityColor.getCPtr(color));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdCmEntityColor colorBottom()
		{
			OdCmEntityColor result = new OdCmEntityColor(GlobalsPINVOKE.OdGiGradientBackgroundTraits_colorBottom(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setHorizon(double horizon)
		{
			GlobalsPINVOKE.OdGiGradientBackgroundTraits_setHorizon(this.swigCPtr, horizon);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual double horizon()
		{
			double result = GlobalsPINVOKE.OdGiGradientBackgroundTraits_horizon(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setHeight(double height)
		{
			GlobalsPINVOKE.OdGiGradientBackgroundTraits_setHeight(this.swigCPtr, height);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual double height()
		{
			double result = GlobalsPINVOKE.OdGiGradientBackgroundTraits_height(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setRotation(double rotation)
		{
			GlobalsPINVOKE.OdGiGradientBackgroundTraits_setRotation(this.swigCPtr, rotation);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual double rotation()
		{
			double result = GlobalsPINVOKE.OdGiGradientBackgroundTraits_rotation(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
